﻿@model List<Scorpicore.MVC.Models.DateFrequencyViewModel>


@{
    ViewBag.Title = "Топ 10 регистрации по дата";
}

<h2 class="legend-title">Топ 10 регистрации по дата</h2>

<div>
    @{ Html.Kendo().Grid(Model)
            .Name("top-ten-dates")
            .Columns(columns =>
            {
                columns.Bound(c => c.Date);
                columns.Bound(c => c.Count);
                columns.Template(
                    @<text>
                        @Ajax.ActionLink("Следи", "DateTracks", "TopTen", new { date = item.Date },
                                     new AjaxOptions { 
                                         InsertionMode = InsertionMode.Replace,
                                         UpdateTargetId = "date-tracks",
                                         OnSuccess = "showReport"
                                     })
                    </text>
                );
            })        
            .Render();
    }
</div>

<div id="date-details">
    <h3 class="legend-title">Следи за тази дата</h3>
    <div id="date-tracks">

    </div>
</div>

<script>
    function showReport() {
        $("#date-details").show();
    }
</script>

<script>
    var rowNumber = 0;

    function resetRowNumber(e) {
        rowNumber = 0;
    }

    function renderNumber(data) {
        return ++rowNumber;
    }
</script>